﻿#include "FITKAbaPredefinedFieldVelocity.h"


Interface::FITKAbaAbstractPredefinedField::FITKAbaPredefinedFiledType Interface::FITKAbaPredefinedFieldVelocity::getPreDefinedType() const
{
    return FITKAbaPredefinedFiledType::Velocity;
}

bool Interface::FITKAbaPredefinedFieldVelocity::isModifiedInStep(int stepId) const
{
    return false;
}

void Interface::FITKAbaPredefinedFieldVelocity::activeStateChanged()
{

}

bool Interface::FITKAbaPredefinedFieldVelocity::isValidInStep(int stepId)
{
    return true;
}

bool Interface::FITKAbaPredefinedFieldVelocity::isValidInCreatedStep()
{
    return true;
}

Interface::FITKAbaStepEnum::StateInStep Interface::FITKAbaPredefinedFieldVelocity::getStateInStep(int stepId)
{
    //数据创建所在的分析步索引
    int createdStepIndex = this->getStepIndex(m_createdStepId);
    if (createdStepIndex == -1)
        return FITKAbaStepEnum::StateInStep::None;
    //要判断状态的step的索引
    int stepIndex = this->getStepIndex(stepId);
    //如果要判断状态的step在创建所在的step之前，则返回无状态
    if (stepIndex < createdStepIndex)
        return FITKAbaStepEnum::StateInStep::None;
    if (m_createdStepId == stepId)
        return FITKAbaStepEnum::StateInStep::Created;
    return FITKAbaStepEnum::StateInStep::Computed;
}

Interface::FITKAbaPredefinedFieldVelocity::VelocityDefinition Interface::FITKAbaPredefinedFieldVelocity::getDefinition() const
{
    return m_definition;
}

void Interface::FITKAbaPredefinedFieldVelocity::setDefinition(VelocityDefinition define)
{
    m_definition = define;
}

double Interface::FITKAbaPredefinedFieldVelocity::getV1() const
{
    return m_V1;
}

void Interface::FITKAbaPredefinedFieldVelocity::setV1(double v1)
{
    m_V1 = v1;
}

double Interface::FITKAbaPredefinedFieldVelocity::getV2() const
{
    return m_V2;
}

void Interface::FITKAbaPredefinedFieldVelocity::setV2(double v2)
{
    m_V2 = v2;
}

double Interface::FITKAbaPredefinedFieldVelocity::getV3() const
{
    return m_V3;
}

void Interface::FITKAbaPredefinedFieldVelocity::setV3(double v3)
{
    m_V3 = v3;
}

double Interface::FITKAbaPredefinedFieldVelocity::getAngularVelocity() const
{
    return m_angularVelocity;
}

void Interface::FITKAbaPredefinedFieldVelocity::setAngularVelocity(double av)
{
    m_angularVelocity = av;
}

std::array<double, 3> Interface::FITKAbaPredefinedFieldVelocity::getAxisPoint1() const
{
    return m_axisPoint1;
}

void Interface::FITKAbaPredefinedFieldVelocity::setAxisPoint1(const std::array<double, 3> &point1)
{
    m_axisPoint1 = point1;
}

std::array<double, 3> Interface::FITKAbaPredefinedFieldVelocity::getAxisPoint2() const
{
    return m_axisPoint2;
}

void Interface::FITKAbaPredefinedFieldVelocity::setAxisPoint2(const std::array<double, 3> &point2)
{
    m_axisPoint2 = point2;
}
